package com.atguigu.gmall.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.user.entity.UserAddress;
import com.atguigu.gmall.user.service.UserAddressService;
import com.atguigu.gmall.user.mapper.UserAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lyd
* @description 针对表【user_address(用户地址表)】的数据库操作Service实现
* @createDate 2023-08-29 16:42:38
*/
@Service
public class UserAddressServiceImpl extends ServiceImpl<UserAddressMapper, UserAddress>
    implements UserAddressService{

    @Autowired
    UserAddressService userAddressService;
    /**
     *  获取用户地址列表
     * @param userId
     * @return
     */
    @Override
    public List<UserAddress> getAddressList(Long userId) {
        List<UserAddress> list = this.lambdaQuery()
                .eq(UserAddress::getUserId, userId)
                .list();
        return list;
    }
}




